<script setup lang="ts">
import { $t } from '@/locales';

defineOptions({
  name: 'RecycleResidualSearch'
});

interface Emits {
  (e: 'reset'): void;
  (e: 'search'): void;
}

const emit = defineEmits<Emits>();

const model = defineModel<Api.Dimo.DmRecycleResidualSearchParams>('model', { required: true });

function reset() {
  emit('reset');
}

function search() {
  emit('search');
}

const authStatusOptions = [
  {
    label: '全部',
    value: 'ALL'
  },
  {
    label: '已审核（区/县）',
    value: 'XY'
  },
  {
    label: '未审核（区/县）',
    value: 'XN'
  },
  {
    label: '已审核（市）',
    value: 'CY'
  },
  {
    label: '未审核（市）',
    value: 'CN'
  },
  {
    label: '已审核（省）',
    value: 'PY'
  },
  {
    label: '未审核（省）',
    value: 'PN'
  }
];
</script>

<template>
  <NCard :bordered="false" size="small" class="card-wrapper">
    <NForm :model="model" label-placement="left" :show-feedback="false" :label-width="80">
      <NGrid responsive="screen" item-responsive :x-gap="8" :y-gap="8" cols="1 s:1 m:5 l:5 xl:5 2xl:5">
        <NGridItem span="4">
          <NGrid responsive="screen" item-responsive :x-gap="8">
            <NFormItemGi span="24 s:8 m:6" label="填报单位" path="reportUnit">
              <NInput v-model:value="model.reportUnit" size="small" placeholder="请输入关键字" />
            </NFormItemGi>
            <NFormItemGi span="24 s:8 m:6" label="市/县" path="orgName">
              <NInput v-model:value="model.orgName" size="small" placeholder="请输入关键字" />
            </NFormItemGi>
            <NFormItemGi span="24 s:8 m:6" label="填报人" path="reportPerson">
              <NInput v-model:value="model.reportPerson" size="small" placeholder="请输入关键字" />
            </NFormItemGi>
            <NFormItemGi span="24 s:8 m:6" label="审核状态" path="authStatus">
              <NSelect v-model:value="model.authStatus" :options="authStatusOptions" />
            </NFormItemGi>
          </NGrid>
        </NGridItem>
        <NGridItem>
          <NFormItemGi span="24 s:8 m:6">
            <NSpace class="w-full" justify="end">
              <NButton type="primary" ghost @click="search">
                <template #icon>
                  <icon-ic-round-search class="text-icon" />
                </template>
                {{ $t('common.search') }}
              </NButton>
              <NButton quaternary @click="reset">
                <template #icon>
                  <icon-ic-round-refresh class="text-icon" />
                </template>
                {{ $t('common.reset') }}
              </NButton>
            </NSpace>
          </NFormItemGi>
        </NGridItem>
      </NGrid>
    </NForm>
  </NCard>
</template>

<style scoped></style>
